home *** CD-ROM | disk | FTP | other *** search
/ MaxiMac 2000 December / MaxiMac 109.iso / KitWeb / Wanadoo / Media / Present.dcr / Scripts_14_SoundBoutton.ls < prev    next >
Encoding:
Text File  |  2000-10-10  |  2.2 KB  |  122 lines

  1. property pCsn, pMb0, pMb1, pMb2, pAlt, pSB, pB
  2.  
  3. on getPropertyDescriptionList
  4.   description = [:]
  5.   addProp(description, #pB, [#default: "Installer", #format: #string, #comment: "Bouton :", #range: ["Installer", "Services"]])
  6.   return description
  7. end
  8.  
  9. on mouseEnter me
  10.   if pCsn <> VOID then
  11.     if not soundBusy(2) then
  12.       case pB of
  13.         "Installer":
  14.           vS = "BIns1h"
  15.           vB = "instal3"
  16.         "Services":
  17.           vS = "Bserv1f"
  18.           vB = "BtSac3"
  19.       end case
  20.       puppetSound(2, vS)
  21.       sprite(pCsn).member = member(vB)
  22.       updateStage()
  23.       pSB = 1
  24.       pAlt = 0
  25.     else
  26.       if pAlt then
  27.         sprite(pCsn).member = pMb1
  28.       end if
  29.     end if
  30.     cursor(280)
  31.   else
  32.     initBouton012()
  33.   end if
  34. end
  35.  
  36. on mouseDown me
  37.   if pCsn <> VOID then
  38.     if pAlt then
  39.       sprite(pCsn).member = pMb2
  40.     end if
  41.     cursor(290)
  42.   else
  43.     initBouton012()
  44.   end if
  45. end
  46.  
  47. on mouseUp me
  48.   if pCsn <> VOID then
  49.     if pAlt then
  50.       sprite(pCsn).member = pMb1
  51.     end if
  52.     cursor(280)
  53.   else
  54.     initBouton012()
  55.   end if
  56. end
  57.  
  58. on mouseWithin me
  59.   if pCsn <> VOID then
  60.     if pAlt then
  61.       sprite(pCsn).member = pMb1
  62.     end if
  63.     cursor(280)
  64.   else
  65.     initBouton012()
  66.   end if
  67. end
  68.  
  69. on mouseLeave me
  70.   if pCsn <> VOID then
  71.     if pAlt then
  72.       sprite(pCsn).member = pMb0
  73.     end if
  74.     cursor(-1)
  75.   else
  76.     initBouton012()
  77.   end if
  78. end
  79.  
  80. on exitFrame me
  81.   if pSB <> VOID then
  82.     if pSB then
  83.       case pB of
  84.         "Installer":
  85.           vS = "BIns1h"
  86.           vB = "instal0"
  87.         "Services":
  88.           vS = "Bserv1f"
  89.           vB = "BtSac0"
  90.       end case
  91.       if soundBusy(2) then
  92.         if sound(2).member.name <> vS then
  93.           pSB = 0
  94.           pAlt = 1
  95.           sprite(pCsn).member = member(vB)
  96.           updateStage()
  97.         end if
  98.       else
  99.         puppetSound(2, 0)
  100.         pSB = 0
  101.         pAlt = 1
  102.         sprite(pCsn).member = member(vB)
  103.         updateStage()
  104.       end if
  105.     end if
  106.   end if
  107. end
  108.  
  109. on initBouton012
  110.   pCsn = the currentSpriteNum
  111.   vName = sprite(pCsn).member.name
  112.   if the last char in vName = "0" then
  113.     delete char -30000 of vName
  114.     pMb0 = vName & "0"
  115.     pMb1 = vName & "1"
  116.     pMb2 = vName & "2"
  117.     pAlt = 1
  118.   else
  119.     pAlt = 0
  120.   end if
  121. end
  122.